package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFilled;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface DishMapper {
    @Select("select count(id)from dish where category_id=#{id}")
    Integer countByCategoryId(Long categoryId);
@AutoFilled(OperationType.INSERT)
    void save(Dish dish);

    Page<DishVO> pageQuery(DishPageQueryDTO dishPageQueryDTO);


    Dish getById(Long id);

    void deleteById(Long id1);
@AutoFilled(OperationType.UPDATE)
    void update(Dish dish);

    List<Dish> getlist(Dish dish);

    void updateStatus(Dish dish);

    Integer countByMap(Map map);

    // Integer countByMap(Map map);

}
